package com.centit.framework.ip.businessdata.po;

import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;


/**
 * create by scaffold 2018-06-04
 *
 * @author guo_jh
 * <p>
 * T_TODO_ITEM各个系统待办事项数据表
 */
@Entity
@Table(name = "T_TODO_ITEM")
public class TodoItem implements java.io.Serializable {
    private static final long serialVersionUID = 1L;


    /**
     * ITEMID 事项ID
     */
    @Id
    @Column(name = "REC_ID")

    private String recId;

    /**
     * ITEMNAME 事项名称
     */
    @Column(name = "ITEMNAME")
    @Length(min = 0, max = 200, message = "字段长度不能小于{min}大于{max}")
    private String itemName;
    /**
     * SYSTEMID 所属系统ID
     */
    @Column(name = "SYSTEMID")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String systemId;
    /**
     * ITEMURL 待办事项链接
     */
    @Column(name = "ITEMURL")
    @Length(min = 0, max = 200, message = "字段长度不能小于{min}大于{max}")
    private String itemUrl;
    /**
     * ITEMSTATE 事项状态
     */
    @Column(name = "ITEMSTATE")
    @Length(min = 0, max = 2, message = "字段长度不能小于{min}大于{max}")
    private String itemState;
    /**
     * CREATETIME 数据推送时间
     */
    @Column(name = "CREATETIME")
    private Date createTime;
    /**
     * UPDATETIME 数据更新时间
     */
    @Column(name = "UPDATETIME")
    private Date updateTime;
    /**
     * ISVALID 数据有效性
     */
    @Column(name = "ISVALID")
    @Length(min = 0, max = 2, message = "字段长度不能小于{min}大于{max}")
    private String isValid;
    /**
     * USER_CODE 用户ID
     */
    @Column(name = "USER_CODE")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String userCode;
    /**
     * CHILD_REC_ID 各子系统待办事项ID
     */
    @Column(name = "CHILD_REC_ID")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String childRecId;

    // Constructors

    /**
     * default constructor
     */
    public TodoItem() {
    }

    /**
     * minimal constructor
     */
    public TodoItem(
            String recId
    ) {


        this.recId = recId;

    }

    /**
     * full constructor
     */
    public TodoItem(
            String recId
            , String itemName, String systemId, String itemUrl, String itemState, Date createTime, Date updateTime, String isValid, String userCode,String childRecId) {


        this.recId = recId;

        this.itemName = itemName;
        this.systemId = systemId;
        this.itemUrl = itemUrl;
        this.itemState = itemState;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.isValid = isValid;
        this.userCode = userCode;
        this.childRecId = childRecId;
    }


    public String getRecId() {
        return this.recId;
    }

    public void setRecId(String recId) {
        this.recId = recId;
    }
    // Property accessors

    public String getItemName() {
        return this.itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getSystemId() {
        return this.systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }

    public String getItemUrl() {
        return this.itemUrl;
    }

    public void setItemUrl(String itemUrl) {
        this.itemUrl = itemUrl;
    }

    public String getItemState() {
        return this.itemState;
    }

    public void setItemState(String itemState) {
        this.itemState = itemState;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getIsValid() {
        return this.isValid;
    }

    public void setIsValid(String isValid) {
        this.isValid = isValid;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getChildRecId() {
        return childRecId;
    }

    public void setChildRecId(String childRecId) {
        this.childRecId = childRecId;
    }

    public TodoItem copy(TodoItem other) {

        this.setRecId(other.getRecId());

        this.itemName = other.getItemName();
        this.systemId = other.getSystemId();
        this.itemUrl = other.getItemUrl();
        this.itemState = other.getItemState();
        this.createTime = other.getCreateTime();
        this.updateTime = other.getUpdateTime();
        this.isValid = other.getIsValid();
        this.userCode = other.getUserCode();
        this.childRecId = other.getChildRecId();

        return this;
    }

    public TodoItem copyNotNullProperty(TodoItem other) {

        if (other.getRecId() != null) {
            this.setRecId(other.getRecId());
        }

        if (other.getItemName() != null) {
            this.itemName = other.getItemName();
        }
        if (other.getSystemId() != null) {
            this.systemId = other.getSystemId();
        }
        if (other.getItemUrl() != null) {
            this.itemUrl = other.getItemUrl();
        }
        if (other.getItemState() != null) {
            this.itemState = other.getItemState();
        }
        if (other.getCreateTime() != null) {
            this.createTime = other.getCreateTime();
        }
        if (other.getUpdateTime() != null) {
            this.updateTime = other.getUpdateTime();
        }
        if (other.getIsValid() != null) {
            this.isValid = other.getIsValid();
        }
        if(other.getUserCode()!=null){
            this.userCode = other.getUserCode();
        }
        if(other.getChildRecId()!=null){
            this.childRecId = other.getChildRecId();
        }

        return this;
    }

    public TodoItem clearProperties() {

        this.itemName = null;
        this.systemId = null;
        this.itemUrl = null;
        this.itemState = null;
        this.createTime = null;
        this.updateTime = null;
        this.isValid = null;
        this.userCode = null;
        this.childRecId = null;

        return this;
    }
}
